package com.wswy.wzcx.ui.adapter

import android.support.v4.util.ArraySet
import com.che.libcommon.recycler.RowFactory
import com.che.libcommon.recycler.RowListAdapter2
import com.che.libcommon.recycler.RowViewHolder
import com.wswy.wzcx.ui.component.WZDBChooseComponent
import com.wswy.wzcx.ui.data.WZDBMode

/**
 * Created by wangduheng26 on 2018/4/19.
 * wangduheng26@gmail.com
 */
class WZDBChooseAdapter(val selectSet: ArraySet<WZDBMode>, factory: RowFactory<WZDBMode>) : RowListAdapter2<WZDBMode>(WZDBMode::class.java, factory) {

    override fun onBindViewHolder(holder: RowViewHolder<WZDBMode>, position: Int) {
        super.onBindViewHolder(holder, position)
        val component = holder.component
        if(component is WZDBChooseComponent){
            component.changeStatus(selectSet.contains(getItem(position)))
        }
    }


}
